package com.wicket.okrframework.integration.dto;

import com.wicket.okrframework.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Objects;
import javax.validation.constraints.NotNull;
import lombok.Data;

@Data
public class OrgStaffingDto extends BaseDto implements Serializable {

  /**
   * 职务ID:
   */
  @NotNull(message = "职务ID不能为空")
  @ApiModelProperty("职务ID")
  private String positionId;

  /**
   * 组织ID:
   */
  @ApiModelProperty("组织ID")
  private String organizationId;

  /**
   * 部门ID:
   */
  @ApiModelProperty("部门ID")
  private String deptId;

  /**
   * 是否自动创建:
   */
  @ApiModelProperty("是否自动创建")
  private String isAutoCreate;

  /**
   * 是否兼职编制:
   */
  @NotNull(message = "是否兼职编制不能为空")
  @ApiModelProperty("是否兼职编制")
  private String isPartTimeStaffing;

  /**
   * 主体生命周期:
   */
  @NotNull(message = "主体生命周期不能为空")
  @ApiModelProperty("主体生命周期")
  private String subjectLifeCycle;

  /**
   * 编制数量:
   */
  @ApiModelProperty("编制数量")
  private Long staffingNum;

  /**
   * 编制ID:
   */
  @ApiModelProperty("编制ID")
  private String staffingId;

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;
    OrgStaffingDto that = (OrgStaffingDto) o;
    return (
      positionId == that.positionId &&
      organizationId == that.organizationId &&
      deptId == that.deptId &&
      isAutoCreate == that.isAutoCreate &&
      isPartTimeStaffing == that.isPartTimeStaffing &&
      subjectLifeCycle == that.subjectLifeCycle &&
      staffingNum == that.staffingNum &&
      staffingId == that.staffingId
    );
  }

  @Override
  public int hashCode() {
    return Objects.hash(
      super.hashCode(),
      positionId,
      organizationId,
      deptId,
      isAutoCreate,
      isPartTimeStaffing,
      subjectLifeCycle,
      staffingNum,
      staffingId
    );
  }
}
